package chap06.task7;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Random;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 11:40
 * @description:
 */
public class Ar {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new FileReader("list.txt"));
    ArrayList<String> array = new ArrayList<String>();
    String line = null;
    while ((line = br.readLine())!= null) {
      array.add(line);
    }
      br.close();
      Random r = new Random();
      int index = r.nextInt(array.size());
      String a = array.get(index);
      System.out.println(a);

  }
}
